<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - id:000977,sync:fuzzer2,src:001052.lcov_info_final - src/emitter.cpp</title>
  <link rel="stylesheet" type="text/css" href="../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../index.html">top level</a> - <a href="index.html">src</a> - emitter.cpp<span style="font-size: 80%;"> (source / <a href="emitter.cpp.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">id:000977,sync:fuzzer2,src:001052.lcov_info_final</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">251</td>
            <td class="headerCovTableEntry">505</td>
            <td class="headerCovTableEntryLo">49.7 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2016-03-13 10:42:47</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">29</td>
            <td class="headerCovTableEntry">61</td>
            <td class="headerCovTableEntryLo">47.5 %</td>
          </tr>
          <tr><td><img src="../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : #include &lt;sstream&gt;</a>
<span class="lineNum">       2 </span>            : 
<span class="lineNum">       3 </span>            : #include &quot;emitterutils.h&quot;
<span class="lineNum">       4 </span>            : #include &quot;indentation.h&quot;  // IWYU pragma: keep
<span class="lineNum">       5 </span>            : #include &quot;yaml-cpp/emitter.h&quot;
<span class="lineNum">       6 </span>            : #include &quot;yaml-cpp/emitterdef.h&quot;
<span class="lineNum">       7 </span>            : #include &quot;yaml-cpp/emittermanip.h&quot;
<span class="lineNum">       8 </span>            : #include &quot;yaml-cpp/exceptions.h&quot;  // IWYU pragma: keep
<span class="lineNum">       9 </span>            : 
<span class="lineNum">      10 </span>            : namespace YAML {
<span class="lineNum">      11 </span>            : class Binary;
<a name="12"><span class="lineNum">      12 </span>            : struct _Null;</a>
<span class="lineNum">      13 </span>            : 
<a name="14"><span class="lineNum">      14 </span><span class="lineNoCov">          0 : Emitter::Emitter() : m_pState(new EmitterState) {}</span></a>
<span class="lineNum">      15 </span>            : 
<span class="lineNum">      16 </span><span class="lineCov">       1081 : Emitter::Emitter(std::ostream&amp; stream)</span>
<a name="17"><span class="lineNum">      17 </span><span class="lineCov">       1081 :     : m_pState(new EmitterState), m_stream(stream) {}</span></a>
<span class="lineNum">      18 </span>            : 
<a name="19"><span class="lineNum">      19 </span><span class="lineCov">       1081 : Emitter::~Emitter() {}</span></a>
<span class="lineNum">      20 </span>            : 
<a name="21"><span class="lineNum">      21 </span><span class="lineNoCov">          0 : const char* Emitter::c_str() const { return m_stream.str(); }</span></a>
<span class="lineNum">      22 </span>            : 
<span class="lineNum">      23 </span><span class="lineNoCov">          0 : std::size_t Emitter::size() const { return m_stream.pos(); }</span>
<a name="24"><span class="lineNum">      24 </span>            : </a>
<span class="lineNum">      25 </span>            : // state checking
<a name="26"><span class="lineNum">      26 </span><span class="lineCov">     165830 : bool Emitter::good() const { return m_pState-&gt;good(); }</span></a>
<span class="lineNum">      27 </span>            : 
<span class="lineNum">      28 </span><span class="lineNoCov">          0 : const std::string Emitter::GetLastError() const {</span>
<span class="lineNum">      29 </span><span class="lineNoCov">          0 :   return m_pState-&gt;GetLastError();</span>
<span class="lineNum">      30 </span>            : }
<a name="31"><span class="lineNum">      31 </span>            : </a>
<span class="lineNum">      32 </span>            : // global setters
<span class="lineNum">      33 </span><span class="lineNoCov">          0 : bool Emitter::SetOutputCharset(EMITTER_MANIP value) {</span>
<span class="lineNum">      34 </span><span class="lineNoCov">          0 :   return m_pState-&gt;SetOutputCharset(value, FmtScope::Global);</span>
<a name="35"><span class="lineNum">      35 </span>            : }</a>
<span class="lineNum">      36 </span>            : 
<span class="lineNum">      37 </span><span class="lineNoCov">          0 : bool Emitter::SetStringFormat(EMITTER_MANIP value) {</span>
<span class="lineNum">      38 </span><span class="lineNoCov">          0 :   return m_pState-&gt;SetStringFormat(value, FmtScope::Global);</span>
<a name="39"><span class="lineNum">      39 </span>            : }</a>
<span class="lineNum">      40 </span>            : 
<span class="lineNum">      41 </span><span class="lineNoCov">          0 : bool Emitter::SetBoolFormat(EMITTER_MANIP value) {</span>
<span class="lineNum">      42 </span><span class="lineNoCov">          0 :   bool ok = false;</span>
<span class="lineNum">      43 </span><span class="lineNoCov">          0 :   if (m_pState-&gt;SetBoolFormat(value, FmtScope::Global))</span>
<span class="lineNum">      44 </span><span class="lineNoCov">          0 :     ok = true;</span>
<span class="lineNum">      45 </span><span class="lineNoCov">          0 :   if (m_pState-&gt;SetBoolCaseFormat(value, FmtScope::Global))</span>
<span class="lineNum">      46 </span><span class="lineNoCov">          0 :     ok = true;</span>
<span class="lineNum">      47 </span><span class="lineNoCov">          0 :   if (m_pState-&gt;SetBoolLengthFormat(value, FmtScope::Global))</span>
<span class="lineNum">      48 </span><span class="lineNoCov">          0 :     ok = true;</span>
<span class="lineNum">      49 </span><span class="lineNoCov">          0 :   return ok;</span>
<a name="50"><span class="lineNum">      50 </span>            : }</a>
<span class="lineNum">      51 </span>            : 
<span class="lineNum">      52 </span><span class="lineNoCov">          0 : bool Emitter::SetIntBase(EMITTER_MANIP value) {</span>
<span class="lineNum">      53 </span><span class="lineNoCov">          0 :   return m_pState-&gt;SetIntFormat(value, FmtScope::Global);</span>
<a name="54"><span class="lineNum">      54 </span>            : }</a>
<span class="lineNum">      55 </span>            : 
<span class="lineNum">      56 </span><span class="lineNoCov">          0 : bool Emitter::SetSeqFormat(EMITTER_MANIP value) {</span>
<span class="lineNum">      57 </span><span class="lineNoCov">          0 :   return m_pState-&gt;SetFlowType(GroupType::Seq, value, FmtScope::Global);</span>
<a name="58"><span class="lineNum">      58 </span>            : }</a>
<span class="lineNum">      59 </span>            : 
<span class="lineNum">      60 </span><span class="lineNoCov">          0 : bool Emitter::SetMapFormat(EMITTER_MANIP value) {</span>
<span class="lineNum">      61 </span><span class="lineNoCov">          0 :   bool ok = false;</span>
<span class="lineNum">      62 </span><span class="lineNoCov">          0 :   if (m_pState-&gt;SetFlowType(GroupType::Map, value, FmtScope::Global))</span>
<span class="lineNum">      63 </span><span class="lineNoCov">          0 :     ok = true;</span>
<span class="lineNum">      64 </span><span class="lineNoCov">          0 :   if (m_pState-&gt;SetMapKeyFormat(value, FmtScope::Global))</span>
<span class="lineNum">      65 </span><span class="lineNoCov">          0 :     ok = true;</span>
<span class="lineNum">      66 </span><span class="lineNoCov">          0 :   return ok;</span>
<a name="67"><span class="lineNum">      67 </span>            : }</a>
<span class="lineNum">      68 </span>            : 
<span class="lineNum">      69 </span><span class="lineNoCov">          0 : bool Emitter::SetIndent(std::size_t n) {</span>
<span class="lineNum">      70 </span><span class="lineNoCov">          0 :   return m_pState-&gt;SetIndent(n, FmtScope::Global);</span>
<a name="71"><span class="lineNum">      71 </span>            : }</a>
<span class="lineNum">      72 </span>            : 
<span class="lineNum">      73 </span><span class="lineNoCov">          0 : bool Emitter::SetPreCommentIndent(std::size_t n) {</span>
<span class="lineNum">      74 </span><span class="lineNoCov">          0 :   return m_pState-&gt;SetPreCommentIndent(n, FmtScope::Global);</span>
<a name="75"><span class="lineNum">      75 </span>            : }</a>
<span class="lineNum">      76 </span>            : 
<span class="lineNum">      77 </span><span class="lineNoCov">          0 : bool Emitter::SetPostCommentIndent(std::size_t n) {</span>
<span class="lineNum">      78 </span><span class="lineNoCov">          0 :   return m_pState-&gt;SetPostCommentIndent(n, FmtScope::Global);</span>
<a name="79"><span class="lineNum">      79 </span>            : }</a>
<span class="lineNum">      80 </span>            : 
<span class="lineNum">      81 </span><span class="lineNoCov">          0 : bool Emitter::SetFloatPrecision(std::size_t n) {</span>
<span class="lineNum">      82 </span><span class="lineNoCov">          0 :   return m_pState-&gt;SetFloatPrecision(n, FmtScope::Global);</span>
<a name="83"><span class="lineNum">      83 </span>            : }</a>
<span class="lineNum">      84 </span>            : 
<span class="lineNum">      85 </span><span class="lineNoCov">          0 : bool Emitter::SetDoublePrecision(std::size_t n) {</span>
<span class="lineNum">      86 </span><span class="lineNoCov">          0 :   return m_pState-&gt;SetDoublePrecision(n, FmtScope::Global);</span>
<span class="lineNum">      87 </span>            : }
<span class="lineNum">      88 </span>            : 
<a name="89"><span class="lineNum">      89 </span>            : // SetLocalValue</a>
<span class="lineNum">      90 </span>            : // . Either start/end a group, or set a modifier locally
<span class="lineNum">      91 </span><span class="lineCov">      88929 : Emitter&amp; Emitter::SetLocalValue(EMITTER_MANIP value) {</span>
<span class="lineNum">      92 </span><span class="lineCov">      88929 :   if (!good())</span>
<span class="lineNum">      93 </span><span class="lineCov">       2130 :     return *this;</span>
<span class="lineNum">      94 </span>            : 
<span class="lineNum">      95 </span><span class="lineCov">      86799 :   switch (value) {</span>
<span class="lineNum">      96 </span>            :     case BeginDoc:
<span class="lineNum">      97 </span><span class="lineNoCov">          0 :       EmitBeginDoc();</span>
<span class="lineNum">      98 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">      99 </span>            :     case EndDoc:
<span class="lineNum">     100 </span><span class="lineNoCov">          0 :       EmitEndDoc();</span>
<span class="lineNum">     101 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     102 </span>            :     case BeginSeq:
<span class="lineNum">     103 </span><span class="lineCov">       6261 :       EmitBeginSeq();</span>
<span class="lineNum">     104 </span><span class="lineCov">       6261 :       break;</span>
<span class="lineNum">     105 </span>            :     case EndSeq:
<span class="lineNum">     106 </span><span class="lineCov">       6205 :       EmitEndSeq();</span>
<span class="lineNum">     107 </span><span class="lineCov">       6205 :       break;</span>
<span class="lineNum">     108 </span>            :     case BeginMap:
<span class="lineNum">     109 </span><span class="lineCov">      11124 :       EmitBeginMap();</span>
<span class="lineNum">     110 </span><span class="lineCov">      11124 :       break;</span>
<span class="lineNum">     111 </span>            :     case EndMap:
<span class="lineNum">     112 </span><span class="lineCov">      11116 :       EmitEndMap();</span>
<span class="lineNum">     113 </span><span class="lineCov">      11116 :       break;</span>
<span class="lineNum">     114 </span>            :     case Key:
<span class="lineNum">     115 </span>            :     case Value:
<span class="lineNum">     116 </span>            :       // deprecated (these can be deduced by the parity of nodes in a map)
<span class="lineNum">     117 </span><span class="lineCov">      34854 :       break;</span>
<span class="lineNum">     118 </span>            :     case TagByKind:
<span class="lineNum">     119 </span><span class="lineNoCov">          0 :       EmitKindTag();</span>
<span class="lineNum">     120 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     121 </span>            :     case Newline:
<span class="lineNum">     122 </span><span class="lineNoCov">          0 :       EmitNewline();</span>
<span class="lineNum">     123 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     124 </span>            :     default:
<span class="lineNum">     125 </span><span class="lineCov">      17239 :       m_pState-&gt;SetLocalValue(value);</span>
<span class="lineNum">     126 </span><span class="lineCov">      17239 :       break;</span>
<span class="lineNum">     127 </span>            :   }
<span class="lineNum">     128 </span><span class="lineCov">      86799 :   return *this;</span>
<a name="129"><span class="lineNum">     129 </span>            : }</a>
<span class="lineNum">     130 </span>            : 
<span class="lineNum">     131 </span><span class="lineNoCov">          0 : Emitter&amp; Emitter::SetLocalIndent(const _Indent&amp; indent) {</span>
<span class="lineNum">     132 </span><span class="lineNoCov">          0 :   m_pState-&gt;SetIndent(indent.value, FmtScope::Local);</span>
<span class="lineNum">     133 </span><span class="lineNoCov">          0 :   return *this;</span>
<a name="134"><span class="lineNum">     134 </span>            : }</a>
<span class="lineNum">     135 </span>            : 
<span class="lineNum">     136 </span><span class="lineNoCov">          0 : Emitter&amp; Emitter::SetLocalPrecision(const _Precision&amp; precision) {</span>
<span class="lineNum">     137 </span><span class="lineNoCov">          0 :   if (precision.floatPrecision &gt;= 0)</span>
<span class="lineNum">     138 </span><span class="lineNoCov">          0 :     m_pState-&gt;SetFloatPrecision(precision.floatPrecision, FmtScope::Local);</span>
<span class="lineNum">     139 </span><span class="lineNoCov">          0 :   if (precision.doublePrecision &gt;= 0)</span>
<span class="lineNum">     140 </span><span class="lineNoCov">          0 :     m_pState-&gt;SetDoublePrecision(precision.doublePrecision, FmtScope::Local);</span>
<span class="lineNum">     141 </span><span class="lineNoCov">          0 :   return *this;</span>
<span class="lineNum">     142 </span>            : }
<a name="143"><span class="lineNum">     143 </span>            : </a>
<span class="lineNum">     144 </span>            : // EmitBeginDoc
<span class="lineNum">     145 </span><span class="lineNoCov">          0 : void Emitter::EmitBeginDoc() {</span>
<span class="lineNum">     146 </span><span class="lineNoCov">          0 :   if (!good())</span>
<span class="lineNum">     147 </span><span class="lineNoCov">          0 :     return;</span>
<span class="lineNum">     148 </span>            : 
<span class="lineNum">     149 </span><span class="lineNoCov">          0 :   if (m_pState-&gt;CurGroupType() != GroupType::NoType) {</span>
<span class="lineNum">     150 </span><span class="lineNoCov">          0 :     m_pState-&gt;SetError(&quot;Unexpected begin document&quot;);</span>
<span class="lineNum">     151 </span><span class="lineNoCov">          0 :     return;</span>
<span class="lineNum">     152 </span>            :   }
<span class="lineNum">     153 </span>            : 
<span class="lineNum">     154 </span><span class="lineNoCov">          0 :   if (m_pState-&gt;HasAnchor() || m_pState-&gt;HasTag()) {</span>
<span class="lineNum">     155 </span><span class="lineNoCov">          0 :     m_pState-&gt;SetError(&quot;Unexpected begin document&quot;);</span>
<span class="lineNum">     156 </span><span class="lineNoCov">          0 :     return;</span>
<span class="lineNum">     157 </span>            :   }
<span class="lineNum">     158 </span>            : 
<span class="lineNum">     159 </span><span class="lineNoCov">          0 :   if (m_stream.col() &gt; 0)</span>
<span class="lineNum">     160 </span><span class="lineNoCov">          0 :     m_stream &lt;&lt; &quot;\n&quot;;</span>
<span class="lineNum">     161 </span><span class="lineNoCov">          0 :   m_stream &lt;&lt; &quot;---\n&quot;;</span>
<span class="lineNum">     162 </span>            : 
<span class="lineNum">     163 </span><span class="lineNoCov">          0 :   m_pState-&gt;StartedDoc();</span>
<span class="lineNum">     164 </span>            : }
<a name="165"><span class="lineNum">     165 </span>            : </a>
<span class="lineNum">     166 </span>            : // EmitEndDoc
<span class="lineNum">     167 </span><span class="lineNoCov">          0 : void Emitter::EmitEndDoc() {</span>
<span class="lineNum">     168 </span><span class="lineNoCov">          0 :   if (!good())</span>
<span class="lineNum">     169 </span><span class="lineNoCov">          0 :     return;</span>
<span class="lineNum">     170 </span>            : 
<span class="lineNum">     171 </span><span class="lineNoCov">          0 :   if (m_pState-&gt;CurGroupType() != GroupType::NoType) {</span>
<span class="lineNum">     172 </span><span class="lineNoCov">          0 :     m_pState-&gt;SetError(&quot;Unexpected begin document&quot;);</span>
<span class="lineNum">     173 </span><span class="lineNoCov">          0 :     return;</span>
<span class="lineNum">     174 </span>            :   }
<span class="lineNum">     175 </span>            : 
<span class="lineNum">     176 </span><span class="lineNoCov">          0 :   if (m_pState-&gt;HasAnchor() || m_pState-&gt;HasTag()) {</span>
<span class="lineNum">     177 </span><span class="lineNoCov">          0 :     m_pState-&gt;SetError(&quot;Unexpected begin document&quot;);</span>
<span class="lineNum">     178 </span><span class="lineNoCov">          0 :     return;</span>
<span class="lineNum">     179 </span>            :   }
<span class="lineNum">     180 </span>            : 
<span class="lineNum">     181 </span><span class="lineNoCov">          0 :   if (m_stream.col() &gt; 0)</span>
<span class="lineNum">     182 </span><span class="lineNoCov">          0 :     m_stream &lt;&lt; &quot;\n&quot;;</span>
<span class="lineNum">     183 </span><span class="lineNoCov">          0 :   m_stream &lt;&lt; &quot;...\n&quot;;</span>
<span class="lineNum">     184 </span>            : }
<a name="185"><span class="lineNum">     185 </span>            : </a>
<span class="lineNum">     186 </span>            : // EmitBeginSeq
<span class="lineNum">     187 </span><span class="lineCov">       6261 : void Emitter::EmitBeginSeq() {</span>
<span class="lineNum">     188 </span><span class="lineCov">       6261 :   if (!good())</span>
<span class="lineNum">     189 </span><span class="lineNoCov">          0 :     return;</span>
<span class="lineNum">     190 </span>            : 
<span class="lineNum">     191 </span><span class="lineCov">       6261 :   PrepareNode(m_pState-&gt;NextGroupType(GroupType::Seq));</span>
<span class="lineNum">     192 </span>            : 
<span class="lineNum">     193 </span><span class="lineCov">       6261 :   m_pState-&gt;StartedGroup(GroupType::Seq);</span>
<span class="lineNum">     194 </span>            : }
<a name="195"><span class="lineNum">     195 </span>            : </a>
<span class="lineNum">     196 </span>            : // EmitEndSeq
<span class="lineNum">     197 </span><span class="lineCov">       6205 : void Emitter::EmitEndSeq() {</span>
<span class="lineNum">     198 </span><span class="lineCov">       6205 :   if (!good())</span>
<span class="lineNum">     199 </span><span class="lineNoCov">          0 :     return;</span>
<span class="lineNum">     200 </span>            : 
<span class="lineNum">     201 </span><span class="lineCov">       6205 :   if (m_pState-&gt;CurGroupChildCount() == 0)</span>
<span class="lineNum">     202 </span><span class="lineCov">        140 :     m_pState-&gt;ForceFlow();</span>
<span class="lineNum">     203 </span>            : 
<span class="lineNum">     204 </span><span class="lineCov">       6205 :   if (m_pState-&gt;CurGroupFlowType() == FlowType::Flow) {</span>
<span class="lineNum">     205 </span><span class="lineCov">        399 :     if (m_stream.comment())</span>
<span class="lineNum">     206 </span><span class="lineNoCov">          0 :       m_stream &lt;&lt; &quot;\n&quot;;</span>
<span class="lineNum">     207 </span><span class="lineCov">        399 :     m_stream &lt;&lt; IndentTo(m_pState-&gt;CurIndent());</span>
<span class="lineNum">     208 </span><span class="lineCov">        399 :     if (m_pState-&gt;CurGroupChildCount() == 0)</span>
<span class="lineNum">     209 </span><span class="lineCov">        140 :       m_stream &lt;&lt; &quot;[&quot;;</span>
<span class="lineNum">     210 </span><span class="lineCov">        399 :     m_stream &lt;&lt; &quot;]&quot;;</span>
<span class="lineNum">     211 </span>            :   }
<span class="lineNum">     212 </span>            : 
<span class="lineNum">     213 </span><span class="lineCov">       6205 :   m_pState-&gt;EndedGroup(GroupType::Seq);</span>
<span class="lineNum">     214 </span>            : }
<a name="215"><span class="lineNum">     215 </span>            : </a>
<span class="lineNum">     216 </span>            : // EmitBeginMap
<span class="lineNum">     217 </span><span class="lineCov">      11124 : void Emitter::EmitBeginMap() {</span>
<span class="lineNum">     218 </span><span class="lineCov">      11124 :   if (!good())</span>
<span class="lineNum">     219 </span><span class="lineNoCov">          0 :     return;</span>
<span class="lineNum">     220 </span>            : 
<span class="lineNum">     221 </span><span class="lineCov">      11124 :   PrepareNode(m_pState-&gt;NextGroupType(GroupType::Map));</span>
<span class="lineNum">     222 </span>            : 
<span class="lineNum">     223 </span><span class="lineCov">      11124 :   m_pState-&gt;StartedGroup(GroupType::Map);</span>
<span class="lineNum">     224 </span>            : }
<a name="225"><span class="lineNum">     225 </span>            : </a>
<span class="lineNum">     226 </span>            : // EmitEndMap
<span class="lineNum">     227 </span><span class="lineCov">      11116 : void Emitter::EmitEndMap() {</span>
<span class="lineNum">     228 </span><span class="lineCov">      11116 :   if (!good())</span>
<span class="lineNum">     229 </span><span class="lineNoCov">          0 :     return;</span>
<span class="lineNum">     230 </span>            : 
<span class="lineNum">     231 </span><span class="lineCov">      11116 :   if (m_pState-&gt;CurGroupChildCount() == 0)</span>
<span class="lineNum">     232 </span><span class="lineCov">        212 :     m_pState-&gt;ForceFlow();</span>
<span class="lineNum">     233 </span>            : 
<span class="lineNum">     234 </span><span class="lineCov">      11116 :   if (m_pState-&gt;CurGroupFlowType() == FlowType::Flow) {</span>
<span class="lineNum">     235 </span><span class="lineCov">        512 :     if (m_stream.comment())</span>
<span class="lineNum">     236 </span><span class="lineNoCov">          0 :       m_stream &lt;&lt; &quot;\n&quot;;</span>
<span class="lineNum">     237 </span><span class="lineCov">        512 :     m_stream &lt;&lt; IndentTo(m_pState-&gt;CurIndent());</span>
<span class="lineNum">     238 </span><span class="lineCov">        512 :     if (m_pState-&gt;CurGroupChildCount() == 0)</span>
<span class="lineNum">     239 </span><span class="lineCov">        212 :       m_stream &lt;&lt; &quot;{&quot;;</span>
<span class="lineNum">     240 </span><span class="lineCov">        512 :     m_stream &lt;&lt; &quot;}&quot;;</span>
<span class="lineNum">     241 </span>            :   }
<span class="lineNum">     242 </span>            : 
<span class="lineNum">     243 </span><span class="lineCov">      11116 :   m_pState-&gt;EndedGroup(GroupType::Map);</span>
<span class="lineNum">     244 </span>            : }
<a name="245"><span class="lineNum">     245 </span>            : </a>
<span class="lineNum">     246 </span>            : // EmitNewline
<span class="lineNum">     247 </span><span class="lineNoCov">          0 : void Emitter::EmitNewline() {</span>
<span class="lineNum">     248 </span><span class="lineNoCov">          0 :   if (!good())</span>
<span class="lineNum">     249 </span><span class="lineNoCov">          0 :     return;</span>
<span class="lineNum">     250 </span>            : 
<span class="lineNum">     251 </span><span class="lineNoCov">          0 :   PrepareNode(EmitterNodeType::NoType);</span>
<span class="lineNum">     252 </span><span class="lineNoCov">          0 :   m_stream &lt;&lt; &quot;\n&quot;;</span>
<span class="lineNum">     253 </span><span class="lineNoCov">          0 :   m_pState-&gt;SetNonContent();</span>
<a name="254"><span class="lineNum">     254 </span>            : }</a>
<span class="lineNum">     255 </span>            : 
<span class="lineNum">     256 </span><span class="lineNoCov">          0 : bool Emitter::CanEmitNewline() const { return true; }</span>
<span class="lineNum">     257 </span>            : 
<a name="258"><span class="lineNum">     258 </span>            : // Put the stream in a state so we can simply write the next node</a>
<span class="lineNum">     259 </span>            : // E.g., if we're in a sequence, write the &quot;- &quot;
<span class="lineNum">     260 </span><span class="lineCov">      56056 : void Emitter::PrepareNode(EmitterNodeType::value child) {</span>
<span class="lineNum">     261 </span><span class="lineCov">      56056 :   switch (m_pState-&gt;CurGroupNodeType()) {</span>
<span class="lineNum">     262 </span>            :     case EmitterNodeType::NoType:
<span class="lineNum">     263 </span><span class="lineCov">       1049 :       PrepareTopNode(child);</span>
<span class="lineNum">     264 </span><span class="lineCov">       1049 :       break;</span>
<span class="lineNum">     265 </span>            :     case EmitterNodeType::FlowSeq:
<span class="lineNum">     266 </span><span class="lineCov">       5927 :       FlowSeqPrepareNode(child);</span>
<span class="lineNum">     267 </span><span class="lineCov">       5927 :       break;</span>
<span class="lineNum">     268 </span>            :     case EmitterNodeType::BlockSeq:
<span class="lineNum">     269 </span><span class="lineCov">      12421 :       BlockSeqPrepareNode(child);</span>
<span class="lineNum">     270 </span><span class="lineCov">      12421 :       break;</span>
<span class="lineNum">     271 </span>            :     case EmitterNodeType::FlowMap:
<span class="lineNum">     272 </span><span class="lineCov">       3361 :       FlowMapPrepareNode(child);</span>
<span class="lineNum">     273 </span><span class="lineCov">       3361 :       break;</span>
<span class="lineNum">     274 </span>            :     case EmitterNodeType::BlockMap:
<span class="lineNum">     275 </span><span class="lineCov">      33298 :       BlockMapPrepareNode(child);</span>
<span class="lineNum">     276 </span><span class="lineCov">      33298 :       break;</span>
<span class="lineNum">     277 </span>            :     case EmitterNodeType::Property:
<span class="lineNum">     278 </span>            :     case EmitterNodeType::Scalar:
<span class="lineNum">     279 </span><span class="lineNoCov">          0 :       assert(false);</span>
<span class="lineNum">     280 </span>            :       break;
<span class="lineNum">     281 </span>            :   }
<a name="282"><span class="lineNum">     282 </span><span class="lineCov">      56056 : }</span></a>
<span class="lineNum">     283 </span>            : 
<span class="lineNum">     284 </span><span class="lineCov">       1049 : void Emitter::PrepareTopNode(EmitterNodeType::value child) {</span>
<span class="lineNum">     285 </span><span class="lineCov">       1049 :   if (child == EmitterNodeType::NoType)</span>
<span class="lineNum">     286 </span><span class="lineNoCov">          0 :     return;</span>
<span class="lineNum">     287 </span>            : 
<span class="lineNum">     288 </span><span class="lineCov">       1049 :   if (m_pState-&gt;CurGroupChildCount() &gt; 0 &amp;&amp; m_stream.col() &gt; 0) {</span>
<span class="lineNum">     289 </span><span class="lineNoCov">          0 :     if (child != EmitterNodeType::NoType)</span>
<span class="lineNum">     290 </span><span class="lineNoCov">          0 :       EmitBeginDoc();</span>
<span class="lineNum">     291 </span>            :   }
<span class="lineNum">     292 </span>            : 
<span class="lineNum">     293 </span><span class="lineCov">       1049 :   switch (child) {</span>
<span class="lineNum">     294 </span>            :     case EmitterNodeType::NoType:
<span class="lineNum">     295 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     296 </span>            :     case EmitterNodeType::Property:
<span class="lineNum">     297 </span>            :     case EmitterNodeType::Scalar:
<span class="lineNum">     298 </span>            :     case EmitterNodeType::FlowSeq:
<span class="lineNum">     299 </span>            :     case EmitterNodeType::FlowMap:
<span class="lineNum">     300 </span>            :       // TODO: if we were writing null, and
<span class="lineNum">     301 </span>            :       // we wanted it blank, we wouldn't want a space
<span class="lineNum">     302 </span><span class="lineCov">        515 :       SpaceOrIndentTo(m_pState-&gt;HasBegunContent(), 0);</span>
<span class="lineNum">     303 </span><span class="lineCov">        515 :       break;</span>
<span class="lineNum">     304 </span>            :     case EmitterNodeType::BlockSeq:
<span class="lineNum">     305 </span>            :     case EmitterNodeType::BlockMap:
<span class="lineNum">     306 </span><span class="lineCov">        534 :       if (m_pState-&gt;HasBegunNode())</span>
<span class="lineNum">     307 </span><span class="lineCov">         17 :         m_stream &lt;&lt; &quot;\n&quot;;</span>
<span class="lineNum">     308 </span><span class="lineCov">        534 :       break;</span>
<span class="lineNum">     309 </span>            :   }
<a name="310"><span class="lineNum">     310 </span>            : }</a>
<span class="lineNum">     311 </span>            : 
<span class="lineNum">     312 </span><span class="lineCov">       5927 : void Emitter::FlowSeqPrepareNode(EmitterNodeType::value child) {</span>
<span class="lineNum">     313 </span><span class="lineCov">       5927 :   const std::size_t lastIndent = m_pState-&gt;LastIndent();</span>
<span class="lineNum">     314 </span>            : 
<span class="lineNum">     315 </span><span class="lineCov">       5927 :   if (!m_pState-&gt;HasBegunNode()) {</span>
<span class="lineNum">     316 </span><span class="lineCov">       5891 :     if (m_stream.comment())</span>
<span class="lineNum">     317 </span><span class="lineNoCov">          0 :       m_stream &lt;&lt; &quot;\n&quot;;</span>
<span class="lineNum">     318 </span><span class="lineCov">       5891 :     m_stream &lt;&lt; IndentTo(lastIndent);</span>
<span class="lineNum">     319 </span><span class="lineCov">       5891 :     if (m_pState-&gt;CurGroupChildCount() == 0)</span>
<span class="lineNum">     320 </span><span class="lineCov">        259 :       m_stream &lt;&lt; &quot;[&quot;;</span>
<span class="lineNum">     321 </span>            :     else
<span class="lineNum">     322 </span><span class="lineCov">       5632 :       m_stream &lt;&lt; &quot;,&quot;;</span>
<span class="lineNum">     323 </span>            :   }
<span class="lineNum">     324 </span>            : 
<span class="lineNum">     325 </span><span class="lineCov">       5927 :   switch (child) {</span>
<span class="lineNum">     326 </span>            :     case EmitterNodeType::NoType:
<span class="lineNum">     327 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     328 </span>            :     case EmitterNodeType::Property:
<span class="lineNum">     329 </span>            :     case EmitterNodeType::Scalar:
<span class="lineNum">     330 </span>            :     case EmitterNodeType::FlowSeq:
<span class="lineNum">     331 </span>            :     case EmitterNodeType::FlowMap:
<span class="lineNum">     332 </span><span class="lineCov">       5927 :       SpaceOrIndentTo(</span>
<span class="lineNum">     333 </span><span class="lineCov">       5927 :           m_pState-&gt;HasBegunContent() || m_pState-&gt;CurGroupChildCount() &gt; 0,</span>
<span class="lineNum">     334 </span><span class="lineCov">       5927 :           lastIndent);</span>
<span class="lineNum">     335 </span><span class="lineCov">       5927 :       break;</span>
<span class="lineNum">     336 </span>            :     case EmitterNodeType::BlockSeq:
<span class="lineNum">     337 </span>            :     case EmitterNodeType::BlockMap:
<span class="lineNum">     338 </span><span class="lineNoCov">          0 :       assert(false);</span>
<span class="lineNum">     339 </span>            :       break;
<span class="lineNum">     340 </span>            :   }
<a name="341"><span class="lineNum">     341 </span><span class="lineCov">       5927 : }</span></a>
<span class="lineNum">     342 </span>            : 
<span class="lineNum">     343 </span><span class="lineCov">      12421 : void Emitter::BlockSeqPrepareNode(EmitterNodeType::value child) {</span>
<span class="lineNum">     344 </span><span class="lineCov">      12421 :   const std::size_t curIndent = m_pState-&gt;CurIndent();</span>
<span class="lineNum">     345 </span><span class="lineCov">      12421 :   const std::size_t nextIndent = curIndent + m_pState-&gt;CurGroupIndent();</span>
<span class="lineNum">     346 </span>            : 
<span class="lineNum">     347 </span><span class="lineCov">      12421 :   if (child == EmitterNodeType::NoType)</span>
<span class="lineNum">     348 </span><span class="lineNoCov">          0 :     return;</span>
<span class="lineNum">     349 </span>            : 
<span class="lineNum">     350 </span><span class="lineCov">      12421 :   if (!m_pState-&gt;HasBegunContent()) {</span>
<span class="lineNum">     351 </span><span class="lineCov">      10266 :     if (m_pState-&gt;CurGroupChildCount() &gt; 0 || m_stream.comment()) {</span>
<span class="lineNum">     352 </span><span class="lineCov">       4404 :       m_stream &lt;&lt; &quot;\n&quot;;</span>
<span class="lineNum">     353 </span>            :     }
<span class="lineNum">     354 </span><span class="lineCov">      10266 :     m_stream &lt;&lt; IndentTo(curIndent);</span>
<span class="lineNum">     355 </span><span class="lineCov">      10266 :     m_stream &lt;&lt; &quot;-&quot;;</span>
<span class="lineNum">     356 </span>            :   }
<span class="lineNum">     357 </span>            : 
<span class="lineNum">     358 </span><span class="lineCov">      12421 :   switch (child) {</span>
<span class="lineNum">     359 </span>            :     case EmitterNodeType::NoType:
<span class="lineNum">     360 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     361 </span>            :     case EmitterNodeType::Property:
<span class="lineNum">     362 </span>            :     case EmitterNodeType::Scalar:
<span class="lineNum">     363 </span>            :     case EmitterNodeType::FlowSeq:
<span class="lineNum">     364 </span>            :     case EmitterNodeType::FlowMap:
<span class="lineNum">     365 </span><span class="lineCov">       7146 :       SpaceOrIndentTo(m_pState-&gt;HasBegunContent(), nextIndent);</span>
<span class="lineNum">     366 </span><span class="lineCov">       7146 :       break;</span>
<span class="lineNum">     367 </span>            :     case EmitterNodeType::BlockSeq:
<span class="lineNum">     368 </span><span class="lineCov">       1305 :       m_stream &lt;&lt; &quot;\n&quot;;</span>
<span class="lineNum">     369 </span><span class="lineCov">       1305 :       break;</span>
<span class="lineNum">     370 </span>            :     case EmitterNodeType::BlockMap:
<span class="lineNum">     371 </span><span class="lineCov">       3970 :       if (m_pState-&gt;HasBegunContent() || m_stream.comment())</span>
<span class="lineNum">     372 </span><span class="lineCov">        144 :         m_stream &lt;&lt; &quot;\n&quot;;</span>
<span class="lineNum">     373 </span><span class="lineCov">       3970 :       break;</span>
<span class="lineNum">     374 </span>            :   }
<a name="375"><span class="lineNum">     375 </span>            : }</a>
<span class="lineNum">     376 </span>            : 
<span class="lineNum">     377 </span><span class="lineCov">       3361 : void Emitter::FlowMapPrepareNode(EmitterNodeType::value child) {</span>
<span class="lineNum">     378 </span><span class="lineCov">       3361 :   if (m_pState-&gt;CurGroupChildCount() % 2 == 0) {</span>
<span class="lineNum">     379 </span><span class="lineCov">       1699 :     if (m_pState-&gt;GetMapKeyFormat() == LongKey)</span>
<span class="lineNum">     380 </span><span class="lineNoCov">          0 :       m_pState-&gt;SetLongKey();</span>
<span class="lineNum">     381 </span>            : 
<span class="lineNum">     382 </span><span class="lineCov">       1699 :     if (m_pState-&gt;CurGroupLongKey())</span>
<span class="lineNum">     383 </span><span class="lineNoCov">          0 :       FlowMapPrepareLongKey(child);</span>
<span class="lineNum">     384 </span>            :     else
<span class="lineNum">     385 </span><span class="lineCov">       1699 :       FlowMapPrepareSimpleKey(child);</span>
<span class="lineNum">     386 </span>            :   } else {
<span class="lineNum">     387 </span><span class="lineCov">       1662 :     if (m_pState-&gt;CurGroupLongKey())</span>
<span class="lineNum">     388 </span><span class="lineNoCov">          0 :       FlowMapPrepareLongKeyValue(child);</span>
<span class="lineNum">     389 </span>            :     else
<span class="lineNum">     390 </span><span class="lineCov">       1662 :       FlowMapPrepareSimpleKeyValue(child);</span>
<span class="lineNum">     391 </span>            :   }
<a name="392"><span class="lineNum">     392 </span><span class="lineCov">       3361 : }</span></a>
<span class="lineNum">     393 </span>            : 
<span class="lineNum">     394 </span><span class="lineNoCov">          0 : void Emitter::FlowMapPrepareLongKey(EmitterNodeType::value child) {</span>
<span class="lineNum">     395 </span><span class="lineNoCov">          0 :   const std::size_t lastIndent = m_pState-&gt;LastIndent();</span>
<span class="lineNum">     396 </span>            : 
<span class="lineNum">     397 </span><span class="lineNoCov">          0 :   if (!m_pState-&gt;HasBegunNode()) {</span>
<span class="lineNum">     398 </span><span class="lineNoCov">          0 :     if (m_stream.comment())</span>
<span class="lineNum">     399 </span><span class="lineNoCov">          0 :       m_stream &lt;&lt; &quot;\n&quot;;</span>
<span class="lineNum">     400 </span><span class="lineNoCov">          0 :     m_stream &lt;&lt; IndentTo(lastIndent);</span>
<span class="lineNum">     401 </span><span class="lineNoCov">          0 :     if (m_pState-&gt;CurGroupChildCount() == 0)</span>
<span class="lineNum">     402 </span><span class="lineNoCov">          0 :       m_stream &lt;&lt; &quot;{ ?&quot;;</span>
<span class="lineNum">     403 </span>            :     else
<span class="lineNum">     404 </span><span class="lineNoCov">          0 :       m_stream &lt;&lt; &quot;, ?&quot;;</span>
<span class="lineNum">     405 </span>            :   }
<span class="lineNum">     406 </span>            : 
<span class="lineNum">     407 </span><span class="lineNoCov">          0 :   switch (child) {</span>
<span class="lineNum">     408 </span>            :     case EmitterNodeType::NoType:
<span class="lineNum">     409 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     410 </span>            :     case EmitterNodeType::Property:
<span class="lineNum">     411 </span>            :     case EmitterNodeType::Scalar:
<span class="lineNum">     412 </span>            :     case EmitterNodeType::FlowSeq:
<span class="lineNum">     413 </span>            :     case EmitterNodeType::FlowMap:
<span class="lineNum">     414 </span><span class="lineNoCov">          0 :       SpaceOrIndentTo(</span>
<span class="lineNum">     415 </span><span class="lineNoCov">          0 :           m_pState-&gt;HasBegunContent() || m_pState-&gt;CurGroupChildCount() &gt; 0,</span>
<span class="lineNum">     416 </span><span class="lineNoCov">          0 :           lastIndent);</span>
<span class="lineNum">     417 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     418 </span>            :     case EmitterNodeType::BlockSeq:
<span class="lineNum">     419 </span>            :     case EmitterNodeType::BlockMap:
<span class="lineNum">     420 </span><span class="lineNoCov">          0 :       assert(false);</span>
<span class="lineNum">     421 </span>            :       break;
<span class="lineNum">     422 </span>            :   }
<a name="423"><span class="lineNum">     423 </span><span class="lineNoCov">          0 : }</span></a>
<span class="lineNum">     424 </span>            : 
<span class="lineNum">     425 </span><span class="lineNoCov">          0 : void Emitter::FlowMapPrepareLongKeyValue(EmitterNodeType::value child) {</span>
<span class="lineNum">     426 </span><span class="lineNoCov">          0 :   const std::size_t lastIndent = m_pState-&gt;LastIndent();</span>
<span class="lineNum">     427 </span>            : 
<span class="lineNum">     428 </span><span class="lineNoCov">          0 :   if (!m_pState-&gt;HasBegunNode()) {</span>
<span class="lineNum">     429 </span><span class="lineNoCov">          0 :     if (m_stream.comment())</span>
<span class="lineNum">     430 </span><span class="lineNoCov">          0 :       m_stream &lt;&lt; &quot;\n&quot;;</span>
<span class="lineNum">     431 </span><span class="lineNoCov">          0 :     m_stream &lt;&lt; IndentTo(lastIndent);</span>
<span class="lineNum">     432 </span><span class="lineNoCov">          0 :     m_stream &lt;&lt; &quot;:&quot;;</span>
<span class="lineNum">     433 </span>            :   }
<span class="lineNum">     434 </span>            : 
<span class="lineNum">     435 </span><span class="lineNoCov">          0 :   switch (child) {</span>
<span class="lineNum">     436 </span>            :     case EmitterNodeType::NoType:
<span class="lineNum">     437 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     438 </span>            :     case EmitterNodeType::Property:
<span class="lineNum">     439 </span>            :     case EmitterNodeType::Scalar:
<span class="lineNum">     440 </span>            :     case EmitterNodeType::FlowSeq:
<span class="lineNum">     441 </span>            :     case EmitterNodeType::FlowMap:
<span class="lineNum">     442 </span><span class="lineNoCov">          0 :       SpaceOrIndentTo(</span>
<span class="lineNum">     443 </span><span class="lineNoCov">          0 :           m_pState-&gt;HasBegunContent() || m_pState-&gt;CurGroupChildCount() &gt; 0,</span>
<span class="lineNum">     444 </span><span class="lineNoCov">          0 :           lastIndent);</span>
<span class="lineNum">     445 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     446 </span>            :     case EmitterNodeType::BlockSeq:
<span class="lineNum">     447 </span>            :     case EmitterNodeType::BlockMap:
<span class="lineNum">     448 </span><span class="lineNoCov">          0 :       assert(false);</span>
<span class="lineNum">     449 </span>            :       break;
<span class="lineNum">     450 </span>            :   }
<a name="451"><span class="lineNum">     451 </span><span class="lineNoCov">          0 : }</span></a>
<span class="lineNum">     452 </span>            : 
<span class="lineNum">     453 </span><span class="lineCov">       1699 : void Emitter::FlowMapPrepareSimpleKey(EmitterNodeType::value child) {</span>
<span class="lineNum">     454 </span><span class="lineCov">       1699 :   const std::size_t lastIndent = m_pState-&gt;LastIndent();</span>
<span class="lineNum">     455 </span>            : 
<span class="lineNum">     456 </span><span class="lineCov">       1699 :   if (!m_pState-&gt;HasBegunNode()) {</span>
<span class="lineNum">     457 </span><span class="lineCov">       1588 :     if (m_stream.comment())</span>
<span class="lineNum">     458 </span><span class="lineNoCov">          0 :       m_stream &lt;&lt; &quot;\n&quot;;</span>
<span class="lineNum">     459 </span><span class="lineCov">       1588 :     m_stream &lt;&lt; IndentTo(lastIndent);</span>
<span class="lineNum">     460 </span><span class="lineCov">       1588 :     if (m_pState-&gt;CurGroupChildCount() == 0)</span>
<span class="lineNum">     461 </span><span class="lineCov">        302 :       m_stream &lt;&lt; &quot;{&quot;;</span>
<span class="lineNum">     462 </span>            :     else
<span class="lineNum">     463 </span><span class="lineCov">       1286 :       m_stream &lt;&lt; &quot;,&quot;;</span>
<span class="lineNum">     464 </span>            :   }
<span class="lineNum">     465 </span>            : 
<span class="lineNum">     466 </span><span class="lineCov">       1699 :   switch (child) {</span>
<span class="lineNum">     467 </span>            :     case EmitterNodeType::NoType:
<span class="lineNum">     468 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     469 </span>            :     case EmitterNodeType::Property:
<span class="lineNum">     470 </span>            :     case EmitterNodeType::Scalar:
<span class="lineNum">     471 </span>            :     case EmitterNodeType::FlowSeq:
<span class="lineNum">     472 </span>            :     case EmitterNodeType::FlowMap:
<span class="lineNum">     473 </span><span class="lineCov">       1699 :       SpaceOrIndentTo(</span>
<span class="lineNum">     474 </span><span class="lineCov">       1699 :           m_pState-&gt;HasBegunContent() || m_pState-&gt;CurGroupChildCount() &gt; 0,</span>
<span class="lineNum">     475 </span><span class="lineCov">       1699 :           lastIndent);</span>
<span class="lineNum">     476 </span><span class="lineCov">       1699 :       break;</span>
<span class="lineNum">     477 </span>            :     case EmitterNodeType::BlockSeq:
<span class="lineNum">     478 </span>            :     case EmitterNodeType::BlockMap:
<span class="lineNum">     479 </span><span class="lineNoCov">          0 :       assert(false);</span>
<span class="lineNum">     480 </span>            :       break;
<span class="lineNum">     481 </span>            :   }
<a name="482"><span class="lineNum">     482 </span><span class="lineCov">       1699 : }</span></a>
<span class="lineNum">     483 </span>            : 
<span class="lineNum">     484 </span><span class="lineCov">       1662 : void Emitter::FlowMapPrepareSimpleKeyValue(EmitterNodeType::value child) {</span>
<span class="lineNum">     485 </span><span class="lineCov">       1662 :   const std::size_t lastIndent = m_pState-&gt;LastIndent();</span>
<span class="lineNum">     486 </span>            : 
<span class="lineNum">     487 </span><span class="lineCov">       1662 :   if (!m_pState-&gt;HasBegunNode()) {</span>
<span class="lineNum">     488 </span><span class="lineCov">       1586 :     if (m_stream.comment())</span>
<span class="lineNum">     489 </span><span class="lineNoCov">          0 :       m_stream &lt;&lt; &quot;\n&quot;;</span>
<span class="lineNum">     490 </span><span class="lineCov">       1586 :     m_stream &lt;&lt; IndentTo(lastIndent);</span>
<span class="lineNum">     491 </span><span class="lineCov">       1586 :     m_stream &lt;&lt; &quot;:&quot;;</span>
<span class="lineNum">     492 </span>            :   }
<span class="lineNum">     493 </span>            : 
<span class="lineNum">     494 </span><span class="lineCov">       1662 :   switch (child) {</span>
<span class="lineNum">     495 </span>            :     case EmitterNodeType::NoType:
<span class="lineNum">     496 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     497 </span>            :     case EmitterNodeType::Property:
<span class="lineNum">     498 </span>            :     case EmitterNodeType::Scalar:
<span class="lineNum">     499 </span>            :     case EmitterNodeType::FlowSeq:
<span class="lineNum">     500 </span>            :     case EmitterNodeType::FlowMap:
<span class="lineNum">     501 </span><span class="lineCov">       1662 :       SpaceOrIndentTo(</span>
<span class="lineNum">     502 </span><span class="lineCov">       1662 :           m_pState-&gt;HasBegunContent() || m_pState-&gt;CurGroupChildCount() &gt; 0,</span>
<span class="lineNum">     503 </span><span class="lineCov">       1662 :           lastIndent);</span>
<span class="lineNum">     504 </span><span class="lineCov">       1662 :       break;</span>
<span class="lineNum">     505 </span>            :     case EmitterNodeType::BlockSeq:
<span class="lineNum">     506 </span>            :     case EmitterNodeType::BlockMap:
<span class="lineNum">     507 </span><span class="lineNoCov">          0 :       assert(false);</span>
<span class="lineNum">     508 </span>            :       break;
<span class="lineNum">     509 </span>            :   }
<a name="510"><span class="lineNum">     510 </span><span class="lineCov">       1662 : }</span></a>
<span class="lineNum">     511 </span>            : 
<span class="lineNum">     512 </span><span class="lineCov">      33298 : void Emitter::BlockMapPrepareNode(EmitterNodeType::value child) {</span>
<span class="lineNum">     513 </span><span class="lineCov">      33298 :   if (m_pState-&gt;CurGroupChildCount() % 2 == 0) {</span>
<span class="lineNum">     514 </span><span class="lineCov">      16077 :     if (m_pState-&gt;GetMapKeyFormat() == LongKey)</span>
<span class="lineNum">     515 </span><span class="lineNoCov">          0 :       m_pState-&gt;SetLongKey();</span>
<span class="lineNum">     516 </span><span class="lineCov">      16077 :     if (child == EmitterNodeType::BlockSeq ||</span>
<span class="lineNum">     517 </span>            :         child == EmitterNodeType::BlockMap)
<span class="lineNum">     518 </span><span class="lineCov">       7432 :       m_pState-&gt;SetLongKey();</span>
<span class="lineNum">     519 </span>            : 
<span class="lineNum">     520 </span><span class="lineCov">      16077 :     if (m_pState-&gt;CurGroupLongKey())</span>
<span class="lineNum">     521 </span><span class="lineCov">       7432 :       BlockMapPrepareLongKey(child);</span>
<span class="lineNum">     522 </span>            :     else
<span class="lineNum">     523 </span><span class="lineCov">       8645 :       BlockMapPrepareSimpleKey(child);</span>
<span class="lineNum">     524 </span>            :   } else {
<span class="lineNum">     525 </span><span class="lineCov">      17221 :     if (m_pState-&gt;CurGroupLongKey())</span>
<span class="lineNum">     526 </span><span class="lineCov">       7440 :       BlockMapPrepareLongKeyValue(child);</span>
<span class="lineNum">     527 </span>            :     else
<span class="lineNum">     528 </span><span class="lineCov">       9781 :       BlockMapPrepareSimpleKeyValue(child);</span>
<span class="lineNum">     529 </span>            :   }
<a name="530"><span class="lineNum">     530 </span><span class="lineCov">      33298 : }</span></a>
<span class="lineNum">     531 </span>            : 
<span class="lineNum">     532 </span><span class="lineCov">       7432 : void Emitter::BlockMapPrepareLongKey(EmitterNodeType::value child) {</span>
<span class="lineNum">     533 </span><span class="lineCov">       7432 :   const std::size_t curIndent = m_pState-&gt;CurIndent();</span>
<span class="lineNum">     534 </span><span class="lineCov">       7432 :   const std::size_t childCount = m_pState-&gt;CurGroupChildCount();</span>
<span class="lineNum">     535 </span>            : 
<span class="lineNum">     536 </span><span class="lineCov">       7432 :   if (child == EmitterNodeType::NoType)</span>
<span class="lineNum">     537 </span><span class="lineNoCov">          0 :     return;</span>
<span class="lineNum">     538 </span>            : 
<span class="lineNum">     539 </span><span class="lineCov">       7432 :   if (!m_pState-&gt;HasBegunContent()) {</span>
<span class="lineNum">     540 </span><span class="lineCov">       7409 :     if (childCount &gt; 0) {</span>
<span class="lineNum">     541 </span><span class="lineCov">        186 :       m_stream &lt;&lt; &quot;\n&quot;;</span>
<span class="lineNum">     542 </span>            :     }
<span class="lineNum">     543 </span><span class="lineCov">       7409 :     if (m_stream.comment()) {</span>
<span class="lineNum">     544 </span><span class="lineNoCov">          0 :       m_stream &lt;&lt; &quot;\n&quot;;</span>
<span class="lineNum">     545 </span>            :     }
<span class="lineNum">     546 </span><span class="lineCov">       7409 :     m_stream &lt;&lt; IndentTo(curIndent);</span>
<span class="lineNum">     547 </span><span class="lineCov">       7409 :     m_stream &lt;&lt; &quot;?&quot;;</span>
<span class="lineNum">     548 </span>            :   }
<span class="lineNum">     549 </span>            : 
<span class="lineNum">     550 </span><span class="lineCov">       7432 :   switch (child) {</span>
<span class="lineNum">     551 </span>            :     case EmitterNodeType::NoType:
<span class="lineNum">     552 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     553 </span>            :     case EmitterNodeType::Property:
<span class="lineNum">     554 </span>            :     case EmitterNodeType::Scalar:
<span class="lineNum">     555 </span>            :     case EmitterNodeType::FlowSeq:
<span class="lineNum">     556 </span>            :     case EmitterNodeType::FlowMap:
<span class="lineNum">     557 </span><span class="lineNoCov">          0 :       SpaceOrIndentTo(true, curIndent + 1);</span>
<span class="lineNum">     558 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     559 </span>            :     case EmitterNodeType::BlockSeq:
<span class="lineNum">     560 </span>            :     case EmitterNodeType::BlockMap:
<span class="lineNum">     561 </span><span class="lineCov">       7432 :       break;</span>
<span class="lineNum">     562 </span>            :   }
<a name="563"><span class="lineNum">     563 </span>            : }</a>
<span class="lineNum">     564 </span>            : 
<span class="lineNum">     565 </span><span class="lineCov">       7440 : void Emitter::BlockMapPrepareLongKeyValue(EmitterNodeType::value child) {</span>
<span class="lineNum">     566 </span><span class="lineCov">       7440 :   const std::size_t curIndent = m_pState-&gt;CurIndent();</span>
<span class="lineNum">     567 </span>            : 
<span class="lineNum">     568 </span><span class="lineCov">       7440 :   if (child == EmitterNodeType::NoType)</span>
<span class="lineNum">     569 </span><span class="lineNoCov">          0 :     return;</span>
<span class="lineNum">     570 </span>            : 
<span class="lineNum">     571 </span><span class="lineCov">       7440 :   if (!m_pState-&gt;HasBegunContent()) {</span>
<span class="lineNum">     572 </span><span class="lineCov">       7432 :     m_stream &lt;&lt; &quot;\n&quot;;</span>
<span class="lineNum">     573 </span><span class="lineCov">       7432 :     m_stream &lt;&lt; IndentTo(curIndent);</span>
<span class="lineNum">     574 </span><span class="lineCov">       7432 :     m_stream &lt;&lt; &quot;:&quot;;</span>
<span class="lineNum">     575 </span>            :   }
<span class="lineNum">     576 </span>            : 
<span class="lineNum">     577 </span><span class="lineCov">       7440 :   switch (child) {</span>
<span class="lineNum">     578 </span>            :     case EmitterNodeType::NoType:
<span class="lineNum">     579 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     580 </span>            :     case EmitterNodeType::Property:
<span class="lineNum">     581 </span>            :     case EmitterNodeType::Scalar:
<span class="lineNum">     582 </span>            :     case EmitterNodeType::FlowSeq:
<span class="lineNum">     583 </span>            :     case EmitterNodeType::FlowMap:
<span class="lineNum">     584 </span>            :     case EmitterNodeType::BlockSeq:
<span class="lineNum">     585 </span>            :     case EmitterNodeType::BlockMap:
<span class="lineNum">     586 </span><span class="lineCov">       7440 :       SpaceOrIndentTo(true, curIndent + 1);</span>
<span class="lineNum">     587 </span><span class="lineCov">       7440 :       break;</span>
<span class="lineNum">     588 </span>            :   }
<a name="589"><span class="lineNum">     589 </span>            : }</a>
<span class="lineNum">     590 </span>            : 
<span class="lineNum">     591 </span><span class="lineCov">       8645 : void Emitter::BlockMapPrepareSimpleKey(EmitterNodeType::value child) {</span>
<span class="lineNum">     592 </span><span class="lineCov">       8645 :   const std::size_t curIndent = m_pState-&gt;CurIndent();</span>
<span class="lineNum">     593 </span><span class="lineCov">       8645 :   const std::size_t childCount = m_pState-&gt;CurGroupChildCount();</span>
<span class="lineNum">     594 </span>            : 
<span class="lineNum">     595 </span><span class="lineCov">       8645 :   if (child == EmitterNodeType::NoType)</span>
<span class="lineNum">     596 </span><span class="lineNoCov">          0 :     return;</span>
<span class="lineNum">     597 </span>            : 
<span class="lineNum">     598 </span><span class="lineCov">       8645 :   if (!m_pState-&gt;HasBegunNode()) {</span>
<span class="lineNum">     599 </span><span class="lineCov">       8433 :     if (childCount &gt; 0) {</span>
<span class="lineNum">     600 </span><span class="lineCov">       5046 :       m_stream &lt;&lt; &quot;\n&quot;;</span>
<span class="lineNum">     601 </span>            :     }
<span class="lineNum">     602 </span>            :   }
<span class="lineNum">     603 </span>            : 
<span class="lineNum">     604 </span><span class="lineCov">       8645 :   switch (child) {</span>
<span class="lineNum">     605 </span>            :     case EmitterNodeType::NoType:
<span class="lineNum">     606 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     607 </span>            :     case EmitterNodeType::Property:
<span class="lineNum">     608 </span>            :     case EmitterNodeType::Scalar:
<span class="lineNum">     609 </span>            :     case EmitterNodeType::FlowSeq:
<span class="lineNum">     610 </span>            :     case EmitterNodeType::FlowMap:
<span class="lineNum">     611 </span><span class="lineCov">       8645 :       SpaceOrIndentTo(m_pState-&gt;HasBegunContent(), curIndent);</span>
<span class="lineNum">     612 </span><span class="lineCov">       8645 :       break;</span>
<span class="lineNum">     613 </span>            :     case EmitterNodeType::BlockSeq:
<span class="lineNum">     614 </span>            :     case EmitterNodeType::BlockMap:
<span class="lineNum">     615 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     616 </span>            :   }
<a name="617"><span class="lineNum">     617 </span>            : }</a>
<span class="lineNum">     618 </span>            : 
<span class="lineNum">     619 </span><span class="lineCov">       9781 : void Emitter::BlockMapPrepareSimpleKeyValue(EmitterNodeType::value child) {</span>
<span class="lineNum">     620 </span><span class="lineCov">       9781 :   const std::size_t curIndent = m_pState-&gt;CurIndent();</span>
<span class="lineNum">     621 </span><span class="lineCov">       9781 :   const std::size_t nextIndent = curIndent + m_pState-&gt;CurGroupIndent();</span>
<span class="lineNum">     622 </span>            : 
<span class="lineNum">     623 </span><span class="lineCov">       9781 :   if (!m_pState-&gt;HasBegunNode()) {</span>
<span class="lineNum">     624 </span><span class="lineCov">       8406 :     m_stream &lt;&lt; &quot;:&quot;;</span>
<span class="lineNum">     625 </span>            :   }
<span class="lineNum">     626 </span>            : 
<span class="lineNum">     627 </span><span class="lineCov">       9781 :   switch (child) {</span>
<span class="lineNum">     628 </span>            :     case EmitterNodeType::NoType:
<span class="lineNum">     629 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     630 </span>            :     case EmitterNodeType::Property:
<span class="lineNum">     631 </span>            :     case EmitterNodeType::Scalar:
<span class="lineNum">     632 </span>            :     case EmitterNodeType::FlowSeq:
<span class="lineNum">     633 </span>            :     case EmitterNodeType::FlowMap:
<span class="lineNum">     634 </span><span class="lineCov">       6645 :       SpaceOrIndentTo(true, nextIndent);</span>
<span class="lineNum">     635 </span><span class="lineCov">       6645 :       break;</span>
<span class="lineNum">     636 </span>            :     case EmitterNodeType::BlockSeq:
<span class="lineNum">     637 </span>            :     case EmitterNodeType::BlockMap:
<span class="lineNum">     638 </span><span class="lineCov">       3136 :       m_stream &lt;&lt; &quot;\n&quot;;</span>
<span class="lineNum">     639 </span><span class="lineCov">       3136 :       break;</span>
<span class="lineNum">     640 </span>            :   }
<span class="lineNum">     641 </span><span class="lineCov">       9781 : }</span>
<span class="lineNum">     642 </span>            : 
<a name="643"><span class="lineNum">     643 </span>            : // SpaceOrIndentTo</a>
<span class="lineNum">     644 </span>            : // . Prepares for some more content by proper spacing
<span class="lineNum">     645 </span><span class="lineCov">      39679 : void Emitter::SpaceOrIndentTo(bool requireSpace, std::size_t indent) {</span>
<span class="lineNum">     646 </span><span class="lineCov">      39679 :   if (m_stream.comment())</span>
<span class="lineNum">     647 </span><span class="lineNoCov">          0 :     m_stream &lt;&lt; &quot;\n&quot;;</span>
<span class="lineNum">     648 </span><span class="lineCov">      39679 :   if (m_stream.col() &gt; 0 &amp;&amp; requireSpace)</span>
<span class="lineNum">     649 </span><span class="lineCov">      25122 :     m_stream &lt;&lt; &quot; &quot;;</span>
<span class="lineNum">     650 </span><span class="lineCov">      39679 :   m_stream &lt;&lt; IndentTo(indent);</span>
<a name="651"><span class="lineNum">     651 </span><span class="lineCov">      39679 : }</span></a>
<span class="lineNum">     652 </span>            : 
<span class="lineNum">     653 </span><span class="lineNoCov">          0 : void Emitter::PrepareIntegralStream(std::stringstream&amp; stream) const {</span>
<span class="lineNum">     654 </span>            : 
<span class="lineNum">     655 </span><span class="lineNoCov">          0 :   switch (m_pState-&gt;GetIntFormat()) {</span>
<span class="lineNum">     656 </span>            :     case Dec:
<span class="lineNum">     657 </span><span class="lineNoCov">          0 :       stream &lt;&lt; std::dec;</span>
<span class="lineNum">     658 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     659 </span>            :     case Hex:
<span class="lineNum">     660 </span><span class="lineNoCov">          0 :       stream &lt;&lt; &quot;0x&quot;;</span>
<span class="lineNum">     661 </span><span class="lineNoCov">          0 :       stream &lt;&lt; std::hex;</span>
<span class="lineNum">     662 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     663 </span>            :     case Oct:
<span class="lineNum">     664 </span><span class="lineNoCov">          0 :       stream &lt;&lt; &quot;0&quot;;</span>
<span class="lineNum">     665 </span><span class="lineNoCov">          0 :       stream &lt;&lt; std::oct;</span>
<span class="lineNum">     666 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     667 </span>            :     default:
<span class="lineNum">     668 </span><span class="lineNoCov">          0 :       assert(false);</span>
<span class="lineNum">     669 </span>            :   }
<a name="670"><span class="lineNum">     670 </span><span class="lineNoCov">          0 : }</span></a>
<span class="lineNum">     671 </span>            : 
<span class="lineNum">     672 </span><span class="lineCov">      34525 : void Emitter::StartedScalar() { m_pState-&gt;StartedScalar(); }</span>
<span class="lineNum">     673 </span>            : 
<span class="lineNum">     674 </span>            : // *******************************************************************************************
<a name="675"><span class="lineNum">     675 </span>            : // overloads of Write</a>
<span class="lineNum">     676 </span>            : 
<span class="lineNum">     677 </span><span class="lineCov">      13697 : Emitter&amp; Emitter::Write(const std::string&amp; str) {</span>
<span class="lineNum">     678 </span><span class="lineCov">      13697 :   if (!good())</span>
<span class="lineNum">     679 </span><span class="lineCov">       1590 :     return *this;</span>
<span class="lineNum">     680 </span>            : 
<span class="lineNum">     681 </span><span class="lineCov">      12107 :   const bool escapeNonAscii = m_pState-&gt;GetOutputCharset() == EscapeNonAscii;</span>
<span class="lineNum">     682 </span>            :   const StringFormat::value strFormat =
<span class="lineNum">     683 </span><span class="lineCov">      12107 :       Utils::ComputeStringFormat(str, m_pState-&gt;GetStringFormat(),</span>
<span class="lineNum">     684 </span><span class="lineCov">      12107 :                                  m_pState-&gt;CurGroupFlowType(), escapeNonAscii);</span>
<span class="lineNum">     685 </span>            : 
<span class="lineNum">     686 </span><span class="lineCov">      12107 :   if (strFormat == StringFormat::Literal)</span>
<span class="lineNum">     687 </span><span class="lineNoCov">          0 :     m_pState-&gt;SetMapKeyFormat(YAML::LongKey, FmtScope::Local);</span>
<span class="lineNum">     688 </span>            : 
<span class="lineNum">     689 </span><span class="lineCov">      12107 :   PrepareNode(EmitterNodeType::Scalar);</span>
<span class="lineNum">     690 </span>            : 
<span class="lineNum">     691 </span><span class="lineCov">      12107 :   switch (strFormat) {</span>
<span class="lineNum">     692 </span>            :     case StringFormat::Plain:
<span class="lineNum">     693 </span><span class="lineCov">       7225 :       m_stream &lt;&lt; str;</span>
<span class="lineNum">     694 </span><span class="lineCov">       7225 :       break;</span>
<span class="lineNum">     695 </span>            :     case StringFormat::SingleQuoted:
<span class="lineNum">     696 </span><span class="lineNoCov">          0 :       Utils::WriteSingleQuotedString(m_stream, str);</span>
<span class="lineNum">     697 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     698 </span>            :     case StringFormat::DoubleQuoted:
<span class="lineNum">     699 </span><span class="lineCov">       4882 :       Utils::WriteDoubleQuotedString(m_stream, str, escapeNonAscii);</span>
<span class="lineNum">     700 </span><span class="lineCov">       4882 :       break;</span>
<span class="lineNum">     701 </span>            :     case StringFormat::Literal:
<span class="lineNum">     702 </span><span class="lineNoCov">          0 :       Utils::WriteLiteralString(m_stream, str,</span>
<span class="lineNum">     703 </span><span class="lineNoCov">          0 :                                 m_pState-&gt;CurIndent() + m_pState-&gt;GetIndent());</span>
<span class="lineNum">     704 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     705 </span>            :   }
<span class="lineNum">     706 </span>            : 
<span class="lineNum">     707 </span><span class="lineCov">      12107 :   StartedScalar();</span>
<span class="lineNum">     708 </span>            : 
<span class="lineNum">     709 </span><span class="lineCov">      12107 :   return *this;</span>
<a name="710"><span class="lineNum">     710 </span>            : }</a>
<span class="lineNum">     711 </span>            : 
<span class="lineNum">     712 </span><span class="lineNoCov">          0 : std::size_t Emitter::GetFloatPrecision() const {</span>
<span class="lineNum">     713 </span><span class="lineNoCov">          0 :   return m_pState-&gt;GetFloatPrecision();</span>
<a name="714"><span class="lineNum">     714 </span>            : }</a>
<span class="lineNum">     715 </span>            : 
<span class="lineNum">     716 </span><span class="lineNoCov">          0 : std::size_t Emitter::GetDoublePrecision() const {</span>
<span class="lineNum">     717 </span><span class="lineNoCov">          0 :   return m_pState-&gt;GetDoublePrecision();</span>
<a name="718"><span class="lineNum">     718 </span>            : }</a>
<span class="lineNum">     719 </span>            : 
<span class="lineNum">     720 </span><span class="lineNoCov">          0 : const char* Emitter::ComputeFullBoolName(bool b) const {</span>
<span class="lineNum">     721 </span><span class="lineNoCov">          0 :   const EMITTER_MANIP mainFmt = (m_pState-&gt;GetBoolLengthFormat() == ShortBool</span>
<span class="lineNum">     722 </span>            :                                      ? YesNoBool
<span class="lineNum">     723 </span><span class="lineNoCov">          0 :                                      : m_pState-&gt;GetBoolFormat());</span>
<span class="lineNum">     724 </span><span class="lineNoCov">          0 :   const EMITTER_MANIP caseFmt = m_pState-&gt;GetBoolCaseFormat();</span>
<span class="lineNum">     725 </span><span class="lineNoCov">          0 :   switch (mainFmt) {</span>
<span class="lineNum">     726 </span>            :     case YesNoBool:
<span class="lineNum">     727 </span><span class="lineNoCov">          0 :       switch (caseFmt) {</span>
<span class="lineNum">     728 </span>            :         case UpperCase:
<span class="lineNum">     729 </span><span class="lineNoCov">          0 :           return b ? &quot;YES&quot; : &quot;NO&quot;;</span>
<span class="lineNum">     730 </span>            :         case CamelCase:
<span class="lineNum">     731 </span><span class="lineNoCov">          0 :           return b ? &quot;Yes&quot; : &quot;No&quot;;</span>
<span class="lineNum">     732 </span>            :         case LowerCase:
<span class="lineNum">     733 </span><span class="lineNoCov">          0 :           return b ? &quot;yes&quot; : &quot;no&quot;;</span>
<span class="lineNum">     734 </span>            :         default:
<span class="lineNum">     735 </span><span class="lineNoCov">          0 :           break;</span>
<span class="lineNum">     736 </span>            :       }
<span class="lineNum">     737 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     738 </span>            :     case OnOffBool:
<span class="lineNum">     739 </span><span class="lineNoCov">          0 :       switch (caseFmt) {</span>
<span class="lineNum">     740 </span>            :         case UpperCase:
<span class="lineNum">     741 </span><span class="lineNoCov">          0 :           return b ? &quot;ON&quot; : &quot;OFF&quot;;</span>
<span class="lineNum">     742 </span>            :         case CamelCase:
<span class="lineNum">     743 </span><span class="lineNoCov">          0 :           return b ? &quot;On&quot; : &quot;Off&quot;;</span>
<span class="lineNum">     744 </span>            :         case LowerCase:
<span class="lineNum">     745 </span><span class="lineNoCov">          0 :           return b ? &quot;on&quot; : &quot;off&quot;;</span>
<span class="lineNum">     746 </span>            :         default:
<span class="lineNum">     747 </span><span class="lineNoCov">          0 :           break;</span>
<span class="lineNum">     748 </span>            :       }
<span class="lineNum">     749 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     750 </span>            :     case TrueFalseBool:
<span class="lineNum">     751 </span><span class="lineNoCov">          0 :       switch (caseFmt) {</span>
<span class="lineNum">     752 </span>            :         case UpperCase:
<span class="lineNum">     753 </span><span class="lineNoCov">          0 :           return b ? &quot;TRUE&quot; : &quot;FALSE&quot;;</span>
<span class="lineNum">     754 </span>            :         case CamelCase:
<span class="lineNum">     755 </span><span class="lineNoCov">          0 :           return b ? &quot;True&quot; : &quot;False&quot;;</span>
<span class="lineNum">     756 </span>            :         case LowerCase:
<span class="lineNum">     757 </span><span class="lineNoCov">          0 :           return b ? &quot;true&quot; : &quot;false&quot;;</span>
<span class="lineNum">     758 </span>            :         default:
<span class="lineNum">     759 </span><span class="lineNoCov">          0 :           break;</span>
<span class="lineNum">     760 </span>            :       }
<span class="lineNum">     761 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     762 </span>            :     default:
<span class="lineNum">     763 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     764 </span>            :   }
<span class="lineNum">     765 </span><span class="lineNoCov">          0 :   return b ? &quot;y&quot; : &quot;n&quot;;  // should never get here, but it can't hurt to give</span>
<span class="lineNum">     766 </span>            :                          // these answers
<a name="767"><span class="lineNum">     767 </span>            : }</a>
<span class="lineNum">     768 </span>            : 
<span class="lineNum">     769 </span><span class="lineNoCov">          0 : Emitter&amp; Emitter::Write(bool b) {</span>
<span class="lineNum">     770 </span><span class="lineNoCov">          0 :   if (!good())</span>
<span class="lineNum">     771 </span><span class="lineNoCov">          0 :     return *this;</span>
<span class="lineNum">     772 </span>            : 
<span class="lineNum">     773 </span><span class="lineNoCov">          0 :   PrepareNode(EmitterNodeType::Scalar);</span>
<span class="lineNum">     774 </span>            : 
<span class="lineNum">     775 </span><span class="lineNoCov">          0 :   const char* name = ComputeFullBoolName(b);</span>
<span class="lineNum">     776 </span><span class="lineNoCov">          0 :   if (m_pState-&gt;GetBoolLengthFormat() == ShortBool)</span>
<span class="lineNum">     777 </span><span class="lineNoCov">          0 :     m_stream &lt;&lt; name[0];</span>
<span class="lineNum">     778 </span>            :   else
<span class="lineNum">     779 </span><span class="lineNoCov">          0 :     m_stream &lt;&lt; name;</span>
<span class="lineNum">     780 </span>            : 
<span class="lineNum">     781 </span><span class="lineNoCov">          0 :   StartedScalar();</span>
<span class="lineNum">     782 </span>            : 
<span class="lineNum">     783 </span><span class="lineNoCov">          0 :   return *this;</span>
<a name="784"><span class="lineNum">     784 </span>            : }</a>
<span class="lineNum">     785 </span>            : 
<span class="lineNum">     786 </span><span class="lineNoCov">          0 : Emitter&amp; Emitter::Write(char ch) {</span>
<span class="lineNum">     787 </span><span class="lineNoCov">          0 :   if (!good())</span>
<span class="lineNum">     788 </span><span class="lineNoCov">          0 :     return *this;</span>
<span class="lineNum">     789 </span>            : 
<span class="lineNum">     790 </span><span class="lineNoCov">          0 :   PrepareNode(EmitterNodeType::Scalar);</span>
<span class="lineNum">     791 </span><span class="lineNoCov">          0 :   Utils::WriteChar(m_stream, ch);</span>
<span class="lineNum">     792 </span><span class="lineNoCov">          0 :   StartedScalar();</span>
<span class="lineNum">     793 </span>            : 
<span class="lineNum">     794 </span><span class="lineNoCov">          0 :   return *this;</span>
<a name="795"><span class="lineNum">     795 </span>            : }</a>
<span class="lineNum">     796 </span>            : 
<span class="lineNum">     797 </span><span class="lineCov">       1990 : Emitter&amp; Emitter::Write(const _Alias&amp; alias) {</span>
<span class="lineNum">     798 </span><span class="lineCov">       1990 :   if (!good())</span>
<span class="lineNum">     799 </span><span class="lineCov">        332 :     return *this;</span>
<span class="lineNum">     800 </span>            : 
<span class="lineNum">     801 </span><span class="lineCov">       1658 :   if (m_pState-&gt;HasAnchor() || m_pState-&gt;HasTag()) {</span>
<span class="lineNum">     802 </span><span class="lineNoCov">          0 :     m_pState-&gt;SetError(ErrorMsg::INVALID_ALIAS);</span>
<span class="lineNum">     803 </span><span class="lineNoCov">          0 :     return *this;</span>
<span class="lineNum">     804 </span>            :   }
<span class="lineNum">     805 </span>            : 
<span class="lineNum">     806 </span><span class="lineCov">       1658 :   PrepareNode(EmitterNodeType::Scalar);</span>
<span class="lineNum">     807 </span>            : 
<span class="lineNum">     808 </span><span class="lineCov">       1658 :   if (!Utils::WriteAlias(m_stream, alias.content)) {</span>
<span class="lineNum">     809 </span><span class="lineNoCov">          0 :     m_pState-&gt;SetError(ErrorMsg::INVALID_ALIAS);</span>
<span class="lineNum">     810 </span><span class="lineNoCov">          0 :     return *this;</span>
<span class="lineNum">     811 </span>            :   }
<span class="lineNum">     812 </span>            : 
<span class="lineNum">     813 </span><span class="lineCov">       1658 :   StartedScalar();</span>
<span class="lineNum">     814 </span>            : 
<span class="lineNum">     815 </span><span class="lineCov">       1658 :   return *this;</span>
<a name="816"><span class="lineNum">     816 </span>            : }</a>
<span class="lineNum">     817 </span>            : 
<span class="lineNum">     818 </span><span class="lineCov">       1131 : Emitter&amp; Emitter::Write(const _Anchor&amp; anchor) {</span>
<span class="lineNum">     819 </span><span class="lineCov">       1131 :   if (!good())</span>
<span class="lineNum">     820 </span><span class="lineCov">        172 :     return *this;</span>
<span class="lineNum">     821 </span>            : 
<span class="lineNum">     822 </span><span class="lineCov">        959 :   if (m_pState-&gt;HasAnchor()) {</span>
<span class="lineNum">     823 </span><span class="lineNoCov">          0 :     m_pState-&gt;SetError(ErrorMsg::INVALID_ANCHOR);</span>
<span class="lineNum">     824 </span><span class="lineNoCov">          0 :     return *this;</span>
<span class="lineNum">     825 </span>            :   }
<span class="lineNum">     826 </span>            : 
<span class="lineNum">     827 </span><span class="lineCov">        959 :   PrepareNode(EmitterNodeType::Property);</span>
<span class="lineNum">     828 </span>            : 
<span class="lineNum">     829 </span><span class="lineCov">        959 :   if (!Utils::WriteAnchor(m_stream, anchor.content)) {</span>
<span class="lineNum">     830 </span><span class="lineNoCov">          0 :     m_pState-&gt;SetError(ErrorMsg::INVALID_ANCHOR);</span>
<span class="lineNum">     831 </span><span class="lineNoCov">          0 :     return *this;</span>
<span class="lineNum">     832 </span>            :   }
<span class="lineNum">     833 </span>            : 
<span class="lineNum">     834 </span><span class="lineCov">        959 :   m_pState-&gt;SetAnchor();</span>
<span class="lineNum">     835 </span>            : 
<span class="lineNum">     836 </span><span class="lineCov">        959 :   return *this;</span>
<a name="837"><span class="lineNum">     837 </span>            : }</a>
<span class="lineNum">     838 </span>            : 
<span class="lineNum">     839 </span><span class="lineCov">       3779 : Emitter&amp; Emitter::Write(const _Tag&amp; tag) {</span>
<span class="lineNum">     840 </span><span class="lineCov">       3779 :   if (!good())</span>
<span class="lineNum">     841 </span><span class="lineCov">        592 :     return *this;</span>
<span class="lineNum">     842 </span>            : 
<span class="lineNum">     843 </span><span class="lineCov">       3187 :   if (m_pState-&gt;HasTag()) {</span>
<span class="lineNum">     844 </span><span class="lineNoCov">          0 :     m_pState-&gt;SetError(ErrorMsg::INVALID_TAG);</span>
<span class="lineNum">     845 </span><span class="lineNoCov">          0 :     return *this;</span>
<span class="lineNum">     846 </span>            :   }
<span class="lineNum">     847 </span>            : 
<span class="lineNum">     848 </span><span class="lineCov">       3187 :   PrepareNode(EmitterNodeType::Property);</span>
<span class="lineNum">     849 </span>            : 
<span class="lineNum">     850 </span><span class="lineCov">       3187 :   bool success = false;</span>
<span class="lineNum">     851 </span><span class="lineCov">       3187 :   if (tag.type == _Tag::Type::Verbatim)</span>
<span class="lineNum">     852 </span><span class="lineCov">       3187 :     success = Utils::WriteTag(m_stream, tag.content, true);</span>
<span class="lineNum">     853 </span><span class="lineNoCov">          0 :   else if (tag.type == _Tag::Type::PrimaryHandle)</span>
<span class="lineNum">     854 </span><span class="lineNoCov">          0 :     success = Utils::WriteTag(m_stream, tag.content, false);</span>
<span class="lineNum">     855 </span>            :   else
<span class="lineNum">     856 </span><span class="lineNoCov">          0 :     success = Utils::WriteTagWithPrefix(m_stream, tag.prefix, tag.content);</span>
<span class="lineNum">     857 </span>            : 
<span class="lineNum">     858 </span><span class="lineCov">       3187 :   if (!success) {</span>
<span class="lineNum">     859 </span><span class="lineCov">         46 :     m_pState-&gt;SetError(ErrorMsg::INVALID_TAG);</span>
<span class="lineNum">     860 </span><span class="lineCov">         46 :     return *this;</span>
<span class="lineNum">     861 </span>            :   }
<span class="lineNum">     862 </span>            : 
<span class="lineNum">     863 </span><span class="lineCov">       3141 :   m_pState-&gt;SetTag();</span>
<span class="lineNum">     864 </span>            : 
<span class="lineNum">     865 </span><span class="lineCov">       3141 :   return *this;</span>
<a name="866"><span class="lineNum">     866 </span>            : }</a>
<span class="lineNum">     867 </span>            : 
<a name="868"><span class="lineNum">     868 </span><span class="lineNoCov">          0 : void Emitter::EmitKindTag() { Write(LocalTag(&quot;&quot;)); }</span></a>
<span class="lineNum">     869 </span>            : 
<span class="lineNum">     870 </span><span class="lineNoCov">          0 : Emitter&amp; Emitter::Write(const _Comment&amp; comment) {</span>
<span class="lineNum">     871 </span><span class="lineNoCov">          0 :   if (!good())</span>
<span class="lineNum">     872 </span><span class="lineNoCov">          0 :     return *this;</span>
<span class="lineNum">     873 </span>            : 
<span class="lineNum">     874 </span><span class="lineNoCov">          0 :   PrepareNode(EmitterNodeType::NoType);</span>
<span class="lineNum">     875 </span>            : 
<span class="lineNum">     876 </span><span class="lineNoCov">          0 :   if (m_stream.col() &gt; 0)</span>
<span class="lineNum">     877 </span><span class="lineNoCov">          0 :     m_stream &lt;&lt; Indentation(m_pState-&gt;GetPreCommentIndent());</span>
<span class="lineNum">     878 </span><span class="lineNoCov">          0 :   Utils::WriteComment(m_stream, comment.content,</span>
<span class="lineNum">     879 </span><span class="lineNoCov">          0 :                       m_pState-&gt;GetPostCommentIndent());</span>
<span class="lineNum">     880 </span>            : 
<span class="lineNum">     881 </span><span class="lineNoCov">          0 :   m_pState-&gt;SetNonContent();</span>
<span class="lineNum">     882 </span>            : 
<span class="lineNum">     883 </span><span class="lineNoCov">          0 :   return *this;</span>
<a name="884"><span class="lineNum">     884 </span>            : }</a>
<span class="lineNum">     885 </span>            : 
<span class="lineNum">     886 </span><span class="lineCov">      21598 : Emitter&amp; Emitter::Write(const _Null&amp; /*null*/) {</span>
<span class="lineNum">     887 </span><span class="lineCov">      21598 :   if (!good())</span>
<span class="lineNum">     888 </span><span class="lineCov">        838 :     return *this;</span>
<span class="lineNum">     889 </span>            : 
<span class="lineNum">     890 </span><span class="lineCov">      20760 :   PrepareNode(EmitterNodeType::Scalar);</span>
<span class="lineNum">     891 </span>            : 
<span class="lineNum">     892 </span><span class="lineCov">      20760 :   m_stream &lt;&lt; &quot;~&quot;;</span>
<span class="lineNum">     893 </span>            : 
<span class="lineNum">     894 </span><span class="lineCov">      20760 :   StartedScalar();</span>
<span class="lineNum">     895 </span>            : 
<span class="lineNum">     896 </span><span class="lineCov">      20760 :   return *this;</span>
<a name="897"><span class="lineNum">     897 </span>            : }</a>
<span class="lineNum">     898 </span>            : 
<span class="lineNum">     899 </span><span class="lineNoCov">          0 : Emitter&amp; Emitter::Write(const Binary&amp; binary) {</span>
<span class="lineNum">     900 </span><span class="lineNoCov">          0 :   Write(SecondaryTag(&quot;binary&quot;));</span>
<span class="lineNum">     901 </span>            : 
<span class="lineNum">     902 </span><span class="lineNoCov">          0 :   if (!good())</span>
<span class="lineNum">     903 </span><span class="lineNoCov">          0 :     return *this;</span>
<span class="lineNum">     904 </span>            : 
<span class="lineNum">     905 </span><span class="lineNoCov">          0 :   PrepareNode(EmitterNodeType::Scalar);</span>
<span class="lineNum">     906 </span><span class="lineNoCov">          0 :   Utils::WriteBinary(m_stream, binary);</span>
<span class="lineNum">     907 </span><span class="lineNoCov">          0 :   StartedScalar();</span>
<span class="lineNum">     908 </span>            : 
<a name="909"><span class="lineNum">     909 </span><span class="lineNoCov">          0 :   return *this;</span></a>
<span class="lineNum">     910 </span>            : }
<span class="lineNum">     911 </span><span class="lineCov">       6108 : }</span>
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.11</a></td></tr>
  </table>
  <br>

</body>
</html>
